/**
 * 权限码装饰器
 * 用于标记需要特定权限的接口
 */

import { SetMetadata } from '@nestjs/common';
import { PermissionCode } from '../enums/permission-code.enum';

export const PERMISSIONS_KEY = 'permissions';

/**
 * 权限码装饰器
 * @param permissions 权限码数组
 */
export const RequirePermission = (...permissions: PermissionCode[]) => {
  return SetMetadata(PERMISSIONS_KEY, permissions);
};

